//
//  Addon.m
//  wiSync
//
//  Created by Javier Segura Perez on 12/22/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "Addon.h"


@implementation Addon

+ (NSString *) replaceCharacterInString:(NSString *)string search:(unichar)s replace:(unichar)r
{
	unichar			aux;
	NSMutableString *buf = [NSMutableString new];
	NSRange			range;
	
	range.location = 0;
	range.length = 1;
	for (range.location = 0; range.location < [string length]; range.location++)
	{
		aux = [string characterAtIndex:range.location];
		if (aux != s)
			[buf appendString:[string substringWithRange:range]];
		else
			[buf appendFormat:@"%C", r];
	}
	return buf;
	
}
@end
